package com.beiwei.util;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;

import com.beiwei.auto.mode.User;
import com.beiwei.service.UserService;
import com.beiwei.service.WeeklogService;

public class Job {

	@Autowired
	private WeeklogService weeklogService;
	@Autowired
	private UserService userService;

	public void createWeeklogs() {

		List<User> users = new ArrayList<User>();// 所有的用户
		try {
			users = userService.findAllUsers();
			weeklogService.addCreateWeeklog(users);

		} catch (Exception e) {
			e.printStackTrace();
		}
		System.out.println("****************定时任务启动（创建周报）****************");
	}
}
